package com.ibm.crl.sb.thread.czbk;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TraditionalTimer {

	/**
	 * @param args
	 * @throws InterruptedException
	 */
	public static void main(String[] args) throws InterruptedException {
		class MyTimerTask extends TimerTask {

			@Override
			public void run() {
				System.out.println("Bomb");
				new Timer().schedule(new MyTimerTask(), 2000);
			}

		}
		new Timer().schedule(new MyTimerTask(), 10000);
		while (true) {
			System.out.println(new Date().getSeconds());
			Thread.sleep(1000);
		}
	}

}
